<?php //** ?>
<form id="UserIndexForm" class="normal search-form clearfix " accept-charset="utf-8" action="/admin/projects/paymentupdatefund" method="post">
<div class="submit">
	<input type="submit" name="Refund" value="<?php echo __l("Refund");?>">
	<input type="submit" name="unRefund" value="<?php echo __l("UnRefund");?>">
</div>
<br/>
<table class="list">
	<tr class="js-even">
		<th><?php echo __l("Select");?></th>
		<th><?php echo __l("Transaction Id");?></th>
		<th><?php echo __l("Payment Id");?></th>
		<th><?php echo __l("Payment Status");?></th>
		<th><?php echo __l("Amount");?></th>
	</tr>
	<?php
	if (!empty($projectFunds)):
	$i = 0;
	$totalAmount = 0;
	foreach ($projectFunds as $projectFund):
		$class = null;
		$class = ' class="altrow expand-row js-odd"';
		
		if(!$projectFund['ProjectFund']['is_refunded']):
			$class = ' class="altrow expand-row js-odd active-record"';
			$totalAmount += $projectFund['ProjectFund']['amount'];
		else:
			$class = ' class="altrow expand-row js-odd inactive-record"';
		endif;
	?>
	<tr<?php echo $class;?>>
		<td>
			<input type="checkbox" name="projectFund[]" value="<?php echo $projectFund['ProjectFund']['id']?>">
		</td>
		<td>
			<?php
				echo $projectFund['ProjectFund']['id'];
			?>
		</td>
		<td>
			<?php
				echo $projectFund['ProjectFund']['pay_key'];
			?>
		</td>
		<td>
			<?php
				echo $projectFund['ProjectFund']['payment_status'];
			?>
		</td>
		<td>
			<?php
				echo $projectFund['ProjectFund']['amount'];
			?>
		</td>
	</tr>
	<?php
    endforeach;
    ?>
    	<td colspan='4'><?php echo __l("Total Amount");?></td><td><?php echo $totalAmount;?></td>
    <?php
	else:
	?>
		<tr class="js-even">
			<td colspan="22" class="notice"><?php echo __l('No Payment available');?></td>
		</tr>
	<?php
	endif;
	?>
</table>
</form>